<extend name="Public/base"/>
<block name="body">
    <div class="main-title">
        <h2>新增商品</h2>
    </div>
    <form action="{:U()}" method="post" class="form-horizontal">
        <div class="form-item">
            <label class="item-label">商品名称<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="title" value="">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">商品描述<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text input-large" name="dec" value="">
            </div>
        </div>
        <div class="form-item">
            <label class="item-label">商品分类<span class="check-tips"></span></label>
              <div class="select">
                <select name="cid" id="">
                          <option value="">请选择</option>
                    <foreach name='cate' item='v' >
                          <option value="{$v.id}">{$v.title}</option>
                     </foreach>
                </select>
            </div> 
        </div>
        <div class="form-item">
            <label class="item-label">商品状态<span class="check-tips"></span></label>
             <input type="radio" name="status" value="0">不显示
             <input type="radio" name="status" value="1">显示
        </div>  
        <div class="form-item">
            <button class="btn submit-btn" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('Shop/catalogue')}');
    </script>
    <script>
     $(function(){
        $(".select").on("change","select",function(){
            var sel= $(this)
            var id = sel.val();
            $.get("{:U('getChild')}",{id:id},
                function(data){
                    if(data.status=1){
                        sel.nextAll().remove();
                        $(".select").append(data.data);
                    }
            });
        })
     });
</script>
</block>

